package com.mingzhi.ai.configuration;

import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.client.advisor.SimpleLoggerAdvisor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ChatClientConfiguration {

    //系统提示语
    public static final String SYSTEM_PROMPT = "你叫明志，是一款智能ai助手，你擅长Java，主要负责逻辑推理和代码编写以及日常答疑，请以友好的态度回答问题！";

    @Bean
    public ChatClient chatClient(ChatClient.Builder chatClientBuilder) {
        return chatClientBuilder
                //系统提示词
                .defaultSystem(SYSTEM_PROMPT)
                //添加日志拦截器
                .defaultAdvisors(new SimpleLoggerAdvisor())
                .build();
    }
}
